#include "StdAfx.h"
#include "Tools.h"
#include "Settings.h"
#include "ini.h"
#include "Inc.h"

CSettings::CSettings(void)
{
	Init();
}

CSettings::~CSettings(void)
{
	Save();
}


void CSettings::Init()
{
	m_cfgPath = (LPCTSTR)CInc::GetInstallPath();
	m_cfgPath += L"\\Config.ini";
}

void CSettings::Load(BOOL pRivacy)
{	
	CIni iniConfig(m_cfgPath.c_str());
	iniConfig.GetString(L"Info",L"Install_Name",LPTSTR(m_InstallName.c_str()),256,L"");
	iniConfig.GetBool(L"Info",L"Rep",TRUE);
}

void CSettings::Save()
{
	CIni iniConfig(m_cfgPath.c_str());
}

void CSettings::SetInstallName( std::wstring& szInstallName )
{
	CIni iniConfig(m_cfgPath.c_str());
	m_InstallName = szInstallName;
	iniConfig.WriteString(L"Info",L"Install_Name",m_InstallName.c_str());
}

void CSettings::SetInstallReport( BOOL bReport )
{
	CIni iniConfig(m_cfgPath.c_str());
	m_bReport = bReport;
	iniConfig.WriteBool(L"Info",L"Rep",m_bReport);	
}